#include<iostream>
using namespace std;
int main()

{
    int B;

    int A=0;

    cin>>B;

    while(B!=0)
    {
        A=A+B;

        cin>>B;
    }

    cout<<A;

    return 1;

}
